// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import 'babel-polyfill'
import VueRouter from 'vue-router'
import router from './router/router'
// import store from './store/store'
Vue.use(VueRouter)


// import { sync } from 'vuex-router-sync'
// sync(store, router)
//ElementUI 样式的引入
import ElementUI from 'element-ui'
Vue.use(ElementUI)
// CSS样式重置方案
import 'normalize.css'
import './../theme/index.css'
import 'assets/css/common.scss'



import ClipboardJS from 'clipboard'
new ClipboardJS('.btn');


// Vue.config.productionTip = false
// const sess = window.sessionStorage

// Vue.mixin({
//   beforeRouteLeave(to,from,next) {
//     const toRoute = to.path;
//     const fromRoute = from.path;
//     const h = JSON.parse(sess.getItem(toRoute));
//     if(h&&h.history){
//       this.$destory()
//       next();
//     }else {
//       next()
//     }
//     next()
//   }
// })
// const beforeEach = function(to,from,next){
//   const toRoute = to.path;
//   const fromRoute = from.path;
//   let h = JSON.parse(sess.getItem(toRoute));
//   if(h&&h.history) {
//     h.history = false;
//     sess.removeItem(toRoute)
//   }else {
//     sess.setItem(fromRoute || '/',JSON.stringify({
//       history: true
//     }))
//   }
//   next()
// }
// router.beforeEach(beforeEach);



/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  // store,
  components: { App },
  template: '<App/>'
})
